Skip to content

Bypass feature validation for dynamic tenant features #9523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jrafanie
Copy link
Member

@jrafanie jrafanie commented Jul 22, 2025

Bypass feature validation for dynamic tenant features

We expect a one to one feature assignment with existing product features.
This doesn't work with dynamic tenant features.

This dynamic tenant feature was only ever implemented for tenant quotas.

Related to:
#5123
#5129
#5142

Fixes: #9512

Add a test for Settings, Access Control, Tenant Add and Delete

This recreates the issue found in #9512

@jrafanie jrafanie requested a review from a team as a code owner July 22, 2025 20:13
@jrafanie jrafanie added the wip label Jul 22, 2025
@Fryguy Fryguy changed the title WIP - bypass feature validation for dynamic tenant features [WIP] bypass feature validation for dynamic tenant features Jul 22, 2025
@Fryguy
Copy link
Member

Fryguy commented Jul 23, 2025

As discussed

tactically, if we change the role_allows to use x_node it would eliminate the params code, and it should just work...long term, there's gotta be a better way that avoids override role_allows at all, and passing in the correct feature from the caller

role_allows shouldn't be dynamically be building features though - something else should be doing that - I'm not sure how the toolbar code is working though
what I think has to happen long term, is we shouldn't be using basic buttons, but should have custom subclasses of the button for tenant stuff

@jrafanie
Copy link
Member Author

Closing in favor of #9527

@jrafanie jrafanie closed this Jul 24, 2025
@jrafanie jrafanie reopened this Aug 13, 2025
@jrafanie jrafanie force-pushed the skip-product-feature-validation-for-tenant-dynamic-product-features branch from c8c8ee5 to c816791 Compare August 13, 2025 18:19
@jrafanie jrafanie added bug and removed wip labels Aug 13, 2025
@jrafanie jrafanie force-pushed the skip-product-feature-validation-for-tenant-dynamic-product-features branch from c816791 to 6484ca9 Compare August 13, 2025 18:23
@jrafanie jrafanie changed the title [WIP] bypass feature validation for dynamic tenant features Bypass feature validation for dynamic tenant features Aug 13, 2025
@jrafanie
Copy link
Member Author

cc @asirvadAbrahamVarghese I used some of your pre-canned functions for the cypress test - let me know if you have better options than what I used.

cy.toolbar(toolBarConfigMenu, 'Add child Tenant to this Tenant');
cy.get('input#name').type(initialTenantName);
cy.get('input#description').type(initialTenantDescription);
cy.contains('.bx--btn--primary', 'Add').click();
Copy link
Contributor

@asirvadAbrahamVarghese asirvadAbrahamVarghese Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is a form can you try using getFormFooterButtonByType
cy.getFormFooterButtonByType('Add', 'submit') should work (not sure about the html button type here)

]);

cy.toolbar(toolBarConfigMenu, 'Add child Tenant to this Tenant');
cy.get('input#name').type(initialTenantName);
Copy link
Contributor

@asirvadAbrahamVarghese asirvadAbrahamVarghese Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we can use getFormInputFieldById
cy.getFormInputFieldById('name').type(initialTenantName); should be good.


cy.toolbar(toolBarConfigMenu, 'Add child Tenant to this Tenant');
cy.get('input#name').type(initialTenantName);
cy.get('input#description').type(initialTenantDescription);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to above: cy.getFormInputFieldById('description').type(initialTenantDescription);

@asirvadAbrahamVarghese
Copy link
Contributor

I haven't come across many form elements yet, but using these commands consistently across tests will help us generalize the selectors in here 😃

// flash message assertions
flashMessageOperationAdded: 'added',
flashMessageOperationDeleted: 'delete',
flashTypeSuccess: 'success',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to use a constant for the flash message type to avoid repetition, but forgot to follow through: #9554

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do that here and update collect_logs as well

We expect a one to one feature assignment with existing product features.
This doesn't work with dynamic tenant features.

This dynamic tenant feature was only ever implemented for tenant quotas.

Related to:
ManageIQ#5123
ManageIQ#5129
ManageIQ#5142

Fixes: ManageIQ#9512
* Drop repetive constant definition and assignment
* Generalize the names of constants
* Capitalize constants as per conventions
@jrafanie jrafanie force-pushed the skip-product-feature-validation-for-tenant-dynamic-product-features branch from 6484ca9 to f601874 Compare August 14, 2025 21:21
@@ -195,7 +192,7 @@ function saveButtonValidation() {
.should('be.enabled')
.click();
// Validating confirmation flash message
cy.expect_flash(flashTypeSuccess, flashMessageSettingsSaved);
cy.expect_flash(flashClassMap.success, flashMessageSettingsSaved);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this one too...

@jrafanie
Copy link
Member Author

@asirvadAbrahamVarghese please take a look at the test changes... I also reduced the repetitive constant definition and assignment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deleting a tenant raises an Server Error
3 participants